package xg2013.totoro.domain;



import java.io.Serializable;
import java.util.Collection;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * @generated
 */
@Entity
@Table(name = "major")
public class Major implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * @generated
	 */
	private String description;
	/**
	 * @generated
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	/**
	 * @generated
	 */
	@ManyToOne
	@JoinColumn(name = "department_id")
	private Department department;
	/**
	 * @generated
	 */
	@OneToMany(mappedBy = "major")
	private Collection<ProjectToMajor> projectToMajors;
	/**
	 * @generated
	 */
	@OneToMany(mappedBy = "major",cascade = CascadeType.ALL)
	private Collection<StudentClass> studentClasses;

	/**
	 * @generated
	 */
	@OneToOne
	@JoinColumn(name = "validity_id")
	private Validity validity;
	private String no;
	/**
	 * @generated
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * @param id 
	 * @generated
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	public String getNo() {
		return no;
	}

	public void setNo(String no) {
		this.no = no;
	}

	/**
	 * @generated
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description 
	 * @generated
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	public Department getDepartment() {
		return department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	public Collection<ProjectToMajor> getProjectToMajors() {
		return projectToMajors;
	}

	public void setProjectToMajors(Collection<ProjectToMajor> projectToMajors) {
		this.projectToMajors = projectToMajors;
	}

	public Collection<StudentClass> getStudentClasses() {
		return studentClasses;
	}

	public void setStudentClasses(Collection<StudentClass> studentClasses) {
		this.studentClasses = studentClasses;
	}

	public Validity getValidity() {
		return validity;
	}

	public void setValidity(Validity validity) {
		this.validity = validity;
	}
	
}